﻿/**********************************天使物流*******************************************
* 功能描述:基本信息-线路
* 作者:石锦涛
* 时间:2022-01-08
* 作者2：李周蓬
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.BaseInfo.Lines;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.BaseInfo.Lines
{
    public class LineApp: ApplicationService
    {
        private readonly ILineAppRepository _lineAppRepository;

        public LineApp(ILineAppRepository lineAppRepository)
        {
            _lineAppRepository = lineAppRepository;
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public async Task<List<LineDto>> GetPage()
        {
            try
            {
                return await _lineAppRepository.GetPage();

            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        ///显示 查询
        /// </summary>
        /// <returns></returns>
        public async Task<List<LineDto>> GetPageId(int id)
        {
            try
            {
                return await _lineAppRepository.GetPageId(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示线路
        /// </summary>
        /// <param name="name"></param>
        /// <param name="begin"></param>
        /// <param name="end"></param>
        /// <param name="shifou"></param>
        /// <param name="phone"></param>
        /// <param name="hid"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<LineDtos>> GetShowLine(string name, string begin, string end, int shifou, string phone, int hid, int pageindex=1, int pagesize=3)
        {
            return await _lineAppRepository.GetShowLine(name, begin,end,shifou,phone,hid, pageindex, pagesize);
        }
        /// <summary>
        /// 删除线路管理
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelLine(int id)
        {
            return await _lineAppRepository.DeleteDelLine(id);
        }
        /// <summary>
        /// 批量删除线路管理
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsLine(string ids)
        {
            return await _lineAppRepository.DeleteDelsLine(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="LineDtos"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateLine(LineDtos lineDtos)
        {
            return await _lineAppRepository.PutUpdateLine(lineDtos);
        }
        /// <summary>
        /// 添加线路管理
        /// </summary>
        /// <param name="LineDtos"></param>
        /// <returns></returns>
        public async Task<int> PostAddLine(LineDtos lineDtos)
        {
            return await _lineAppRepository.PostAddLine(lineDtos);
        }
        /// <summary>
        /// 绑定
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<OwnerDto>> GetBind()
        {
            return await _lineAppRepository.GetBind();
        }
    }
}
